﻿using System;
using System.ComponentModel;
using System.Linq.Expressions;
using SoftSource.Common;
using SoftSource.Timecard.ViewModelInterfaces;
using SoftSource.Timecard.Web.Data;

namespace SoftSource.Timecard.ViewModels
{
    public sealed class ProjectMemberEditorViewModel : IProjectMemberEditorViewModel
    {
        #region IProjectMemberEditorViewModel Members

        private ProjectMember member;
        public ProjectMember Member
        {
            get { return this.member; }
            set
            {
                this.member = value;
                this.PropertyChanged.Notify(() => this.Member);
            }
        }

        private Action completed;
        public Action Completed
        {
            get { return this.completed; }
            set
            {
                this.completed = value;
                this.PropertyChanged.Notify(() => this.Completed);
            }
        }

        public IObservable<Unit> Load { get; set; }

        #endregion

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region IDisposable Members

        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }

        #endregion

        ~ProjectMemberEditorViewModel()
        {
            this.Dispose();
        }
    }
}
